package com.dalin.framework.vos;

public class ResResult {
	private String message;
	private Integer httpCode;
	private Boolean success;
	private Object data;

	public ResResult(Boolean success, Integer httpCode,  String message, Object data) {
		super();
		this.message = message;
		this.httpCode = httpCode;
		this.success = success;
		this.data = data;
	}

	// 静态方法创建成功的响应
	public static ResResult getSuccessRes() {
		return getSuccessRes("请求成功", null);
	}
	public static ResResult getSuccessRes(Object data) {
		return getSuccessRes("请求成功", data);
	}
	public static ResResult getSuccessRes(String message, Object data) {
		return new ResResult(true, 200, message, data);
	}

	// 静态方法创建失败的响应
	public static ResResult getFailureRes() {
		return new ResResult(false, 500, "请求失败", null);
	}
	public static ResResult getFailureRes(Object data) {
		return new ResResult(false, 500, "请求失败", data);
	}
	public static ResResult getFailureRes(String message, Object data) {
		return new ResResult(false, 500, message, data);
	}







	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Boolean getSuccess() {
		return success;
	}

	public void setSuccess(Boolean success) {
		this.success = success;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public Integer getHttpCode() {
		return httpCode;
	}

	public void setHttpCode(Integer httpCode) {
		this.httpCode = httpCode;
	}
}
